#include <cnet.h>

//----------------cnet includes------------------
#include <cnet.h>
//-----------------------------------------------



//-----------link-layer functionality------------
//sending
#include "link_layer/dl_sending.c"
//receiving
#include "link_layer/dl_receiving.c"
//-----------------------------------------------


//function called on node startup
void reboot_node(CnetEvent ev, CnetTimerID timer, CnetData data)
{	
	
	//send handler
	CHECK(CNET_set_handler(EV_APPLICATIONREADY, DL_new_msg, 0));
	
	//receive handler
	CHECK(CNET_set_handler(EV_PHYSICALREADY, DL_receive_msg, 0));
	
	//timeout handler
	CHECK(CNET_set_handler( EV_TIMER1, DL_timeouts, 0));
	
	//enable send/receive on all nodes
	CNET_enable_application(ALLNODES);
	
}
